﻿using System;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using AnyOffice.Components;
using AnyOffice.DAL;
using AnyOffice.Model;
using System.Reflection;
using log4net;

namespace AnyOffice.general.system.bbs
{
    public partial class _new : ModulePage
    {
        private static ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

    
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.Page.IsPostBack)
            {
                try
                {
                    BbsBoardDao dao = new BbsBoardDao();
                    BbsBoardData data = new BbsBoardData();
                    data.BoardNo = Convert.ToInt32(this.txtBoardNo.Value);
                    data.BoardName = this.txtBoardName.Value;
                    data.WelcomeText = this.txtWelcomeText.Value;
                    data.DeptId = this.DeptId.Value;
                    data.Owner = this.Owner.Value;
                    data.IsAnonymous = Convert.ToBoolean(this.sltIsAnonymous.Value);
                    dao.Insert(base.Conn, data);
                }
                catch (Exception exception)
                {
                    if (log.IsErrorEnabled)
                    {
                        log.Error("", exception);
                    }
                }
                base.CloseConn();
                Response.Redirect("index.aspx");
            }
        }
 

    }
}
